3.548 \(\int \frac{\cos ^4(c+d x)}{a+b \tan (c+d x)} \, dx\)

Optimal. Leaf size=152 \[ \frac{\cos ^4(c+d x) (a \tan (c+d x)+b)}{4 d \left (a^2+b^2\right )}+\frac{\cos ^2(c+d x) \left (a \left (3 a^2+7 b^2\right ) \tan (c+d x)+4 b^3\right )}{8 d \left (a^2+b^2\right )^2}+\frac{b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}+\frac{a x \left (10 a^2 b^2+3 a^4+15 b^4\right )}{8 \left (a^2+b^2\right )^3} \]

[Out]

(a*(3*a^4 + 10*a^2*b^2 + 15*b^4)*x)/(8*(a^2 + b^2)^3) + (b^5*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2
)^3*d) + (Cos[c + d*x]^4*(b + a*Tan[c + d*x]))/(4*(a^2 + b^2)*d) + (Cos[c + d*x]^2*(4*b^3 + a*(3*a^2 + 7*b^2)*
Tan[c + d*x]))/(8*(a^2 + b^2)^2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.197114, antiderivative size = 152, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3506, 741, 823, 801, 635, 203, 260} \[ \frac{\cos ^4(c+d x) (a \tan (c+d x)+b)}{4 d \left (a^2+b^2\right )}+\frac{\cos ^2(c+d x) \left (a \left (3 a^2+7 b^2\right ) \tan (c+d x)+4 b^3\right )}{8 d \left (a^2+b^2\right )^2}+\frac{b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )^3}+\frac{a x \left (10 a^2 b^2+3 a^4+15 b^4\right )}{8 \left (a^2+b^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

(a*(3*a^4 + 10*a^2*b^2 + 15*b^4)*x)/(8*(a^2 + b^2)^3) + (b^5*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2
)^3*d) + (Cos[c + d*x]^4*(b + a*Tan[c + d*x]))/(4*(a^2 + b^2)*d) + (Cos[c + d*x]^2*(4*b^3 + a*(3*a^2 + 7*b^2)*
Tan[c + d*x]))/(8*(a^2 + b^2)^2*d)

Rule 3506

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rule 741

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> -Simp[((d + e*x)^(m + 1)*(a*e + c*d*x)*(
a + c*x^2)^(p + 1))/(2*a*(p + 1)*(c*d^2 + a*e^2)), x] + Dist[1/(2*a*(p + 1)*(c*d^2 + a*e^2)), Int[(d + e*x)^m*
Simp[c*d^2*(2*p + 3) + a*e^2*(m + 2*p + 3) + c*e*d*(m + 2*p + 4)*x, x]*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a
, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[p, -1] && IntQuadraticQ[a, 0, c, d, e, m, p, x]

Rule 823

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> -Simp[((d + e*x)^(
m + 1)*(f*a*c*e - a*g*c*d + c*(c*d*f + a*e*g)*x)*(a + c*x^2)^(p + 1))/(2*a*c*(p + 1)*(c*d^2 + a*e^2)), x] + Di
st[1/(2*a*c*(p + 1)*(c*d^2 + a*e^2)), Int[(d + e*x)^m*(a + c*x^2)^(p + 1)*Simp[f*(c^2*d^2*(2*p + 3) + a*c*e^2*
(m + 2*p + 3)) - a*c*d*e*g*m + c*e*(c*d*f + a*e*g)*(m + 2*p + 4)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g}, x]
 && NeQ[c*d^2 + a*e^2, 0] && LtQ[p, -1] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{\cos ^4(c+d x)}{a+b \tan (c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{(a+x) \left (1+\frac{x^2}{b^2}\right )^3} \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}-\frac{b \operatorname{Subst}\left (\int \frac{-4-\frac{3 a^2}{b^2}-\frac{3 a x}{b^2}}{(a+x) \left (1+\frac{x^2}{b^2}\right )^2} \, dx,x,b \tan (c+d x)\right )}{4 \left (a^2+b^2\right ) d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}+\frac{\cos ^2(c+d x) \left (4 b^3+a \left (3 a^2+7 b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{b^5 \operatorname{Subst}\left (\int \frac{\frac{3 a^4+7 a^2 b^2+8 b^4}{b^6}+\frac{a \left (3 a^2+7 b^2\right ) x}{b^6}}{(a+x) \left (1+\frac{x^2}{b^2}\right )} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}\\ &=\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}+\frac{\cos ^2(c+d x) \left (4 b^3+a \left (3 a^2+7 b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{b^5 \operatorname{Subst}\left (\int \left (\frac{8}{\left (a^2+b^2\right ) (a+x)}+\frac{3 a^5+10 a^3 b^2+15 a b^4-8 b^4 x}{b^4 \left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}\\ &=\frac{b^5 \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}+\frac{\cos ^2(c+d x) \left (4 b^3+a \left (3 a^2+7 b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac{b \operatorname{Subst}\left (\int \frac{3 a^5+10 a^3 b^2+15 a b^4-8 b^4 x}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^3 d}\\ &=\frac{b^5 \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}+\frac{\cos ^2(c+d x) \left (4 b^3+a \left (3 a^2+7 b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}-\frac{b^5 \operatorname{Subst}\left (\int \frac{x}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{\left (a^2+b^2\right )^3 d}+\frac{\left (a b \left (3 a^4+10 a^2 b^2+15 b^4\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2+x^2} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^3 d}\\ &=\frac{a \left (3 a^4+10 a^2 b^2+15 b^4\right ) x}{8 \left (a^2+b^2\right )^3}+\frac{b^5 \log (\cos (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{b^5 \log (a+b \tan (c+d x))}{\left (a^2+b^2\right )^3 d}+\frac{\cos ^4(c+d x) (b+a \tan (c+d x))}{4 \left (a^2+b^2\right ) d}+\frac{\cos ^2(c+d x) \left (4 b^3+a \left (3 a^2+7 b^2\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}\\ \end{align*}

Mathematica [A]  time = 0.395122, size = 218, normalized size = 1.43 \[ \frac{24 a^3 b^2 \sin (2 (c+d x))+2 a^3 b^2 \sin (4 (c+d x))+4 b \left (4 a^2 b^2+a^4+3 b^4\right ) \cos (2 (c+d x))+b \left (a^2+b^2\right )^2 \cos (4 (c+d x))+40 a^3 b^2 c+40 a^3 b^2 d x+8 a^5 \sin (2 (c+d x))+a^5 \sin (4 (c+d x))+12 a^5 c+12 a^5 d x+16 a b^4 \sin (2 (c+d x))+a b^4 \sin (4 (c+d x))+32 b^5 \log (a \cos (c+d x)+b \sin (c+d x))+60 a b^4 c+60 a b^4 d x}{32 d \left (a^2+b^2\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4/(a + b*Tan[c + d*x]),x]

[Out]

(12*a^5*c + 40*a^3*b^2*c + 60*a*b^4*c + 12*a^5*d*x + 40*a^3*b^2*d*x + 60*a*b^4*d*x + 4*b*(a^4 + 4*a^2*b^2 + 3*
b^4)*Cos[2*(c + d*x)] + b*(a^2 + b^2)^2*Cos[4*(c + d*x)] + 32*b^5*Log[a*Cos[c + d*x] + b*Sin[c + d*x]] + 8*a^5
*Sin[2*(c + d*x)] + 24*a^3*b^2*Sin[2*(c + d*x)] + 16*a*b^4*Sin[2*(c + d*x)] + a^5*Sin[4*(c + d*x)] + 2*a^3*b^2
*Sin[4*(c + d*x)] + a*b^4*Sin[4*(c + d*x)])/(32*(a^2 + b^2)^3*d)

________________________________________________________________________________________

Maple [B]  time = 0.086, size = 524, normalized size = 3.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4/(a+b*tan(d*x+c)),x)

[Out]

3/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a^5+5/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a^3*b^
2+7/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^3*a*b^4+1/2/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^2*a^
2*b^3+1/2/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)^2*b^5+7/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a^
3*b^2+9/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a*b^4+5/8/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*tan(d*x+c)*a^
5+1/4/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*a^4*b+1/d/(a^2+b^2)^3/(1+tan(d*x+c)^2)^2*a^2*b^3+3/4/d/(a^2+b^2)^3/(1+t
an(d*x+c)^2)^2*b^5-1/2/d/(a^2+b^2)^3*b^5*ln(1+tan(d*x+c)^2)+15/8/d/(a^2+b^2)^3*arctan(tan(d*x+c))*a*b^4+3/8/d/
(a^2+b^2)^3*arctan(tan(d*x+c))*a^5+5/4/d/(a^2+b^2)^3*arctan(tan(d*x+c))*a^3*b^2+1/d*b^5/(a^2+b^2)^3*ln(a+b*tan
(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.80161, size = 366, normalized size = 2.41 \begin{align*} \frac{\frac{8 \, b^{5} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} - \frac{4 \, b^{5} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{4 \, b^{3} \tan \left (d x + c\right )^{2} +{\left (3 \, a^{3} + 7 \, a b^{2}\right )} \tan \left (d x + c\right )^{3} + 2 \, a^{2} b + 6 \, b^{3} +{\left (5 \, a^{3} + 9 \, a b^{2}\right )} \tan \left (d x + c\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (d x + c\right )^{4} + a^{4} + 2 \, a^{2} b^{2} + b^{4} + 2 \,{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (d x + c\right )^{2}}}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/8*(8*b^5*log(b*tan(d*x + c) + a)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 4*b^5*log(tan(d*x + c)^2 + 1)/(a^6 +
3*a^4*b^2 + 3*a^2*b^4 + b^6) + (3*a^5 + 10*a^3*b^2 + 15*a*b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) +
 (4*b^3*tan(d*x + c)^2 + (3*a^3 + 7*a*b^2)*tan(d*x + c)^3 + 2*a^2*b + 6*b^3 + (5*a^3 + 9*a*b^2)*tan(d*x + c))/
((a^4 + 2*a^2*b^2 + b^4)*tan(d*x + c)^4 + a^4 + 2*a^2*b^2 + b^4 + 2*(a^4 + 2*a^2*b^2 + b^4)*tan(d*x + c)^2))/d

________________________________________________________________________________________

Fricas [A]  time = 2.05428, size = 471, normalized size = 3.1 \begin{align*} \frac{4 \, b^{5} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) + 2 \,{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{4} +{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )} d x + 4 \,{\left (a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{2} +{\left (2 \,{\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{3} +{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 7 \, a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \,{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/8*(4*b^5*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) + 2*(a^4*b + 2*a^2*b^3 + b^
5)*cos(d*x + c)^4 + (3*a^5 + 10*a^3*b^2 + 15*a*b^4)*d*x + 4*(a^2*b^3 + b^5)*cos(d*x + c)^2 + (2*(a^5 + 2*a^3*b
^2 + a*b^4)*cos(d*x + c)^3 + (3*a^5 + 10*a^3*b^2 + 7*a*b^4)*cos(d*x + c))*sin(d*x + c))/((a^6 + 3*a^4*b^2 + 3*
a^2*b^4 + b^6)*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4/(a+b*tan(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.4601, size = 435, normalized size = 2.86 \begin{align*} \frac{\frac{8 \, b^{6} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}} - \frac{4 \, b^{5} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{6 \, b^{5} \tan \left (d x + c\right )^{4} + 3 \, a^{5} \tan \left (d x + c\right )^{3} + 10 \, a^{3} b^{2} \tan \left (d x + c\right )^{3} + 7 \, a b^{4} \tan \left (d x + c\right )^{3} + 4 \, a^{2} b^{3} \tan \left (d x + c\right )^{2} + 16 \, b^{5} \tan \left (d x + c\right )^{2} + 5 \, a^{5} \tan \left (d x + c\right ) + 14 \, a^{3} b^{2} \tan \left (d x + c\right ) + 9 \, a b^{4} \tan \left (d x + c\right ) + 2 \, a^{4} b + 8 \, a^{2} b^{3} + 12 \, b^{5}}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}{\left (\tan \left (d x + c\right )^{2} + 1\right )}^{2}}}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/8*(8*b^6*log(abs(b*tan(d*x + c) + a))/(a^6*b + 3*a^4*b^3 + 3*a^2*b^5 + b^7) - 4*b^5*log(tan(d*x + c)^2 + 1)/
(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + (3*a^5 + 10*a^3*b^2 + 15*a*b^4)*(d*x + c)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 +
 b^6) + (6*b^5*tan(d*x + c)^4 + 3*a^5*tan(d*x + c)^3 + 10*a^3*b^2*tan(d*x + c)^3 + 7*a*b^4*tan(d*x + c)^3 + 4*
a^2*b^3*tan(d*x + c)^2 + 16*b^5*tan(d*x + c)^2 + 5*a^5*tan(d*x + c) + 14*a^3*b^2*tan(d*x + c) + 9*a*b^4*tan(d*
x + c) + 2*a^4*b + 8*a^2*b^3 + 12*b^5)/((a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*(tan(d*x + c)^2 + 1)^2))/d